home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / sos3-2_r.lha / INSTALL.SOS3-2 next >
Text File  |  1992-02-13  |  3KB  |  124 lines

  1. #!/bin/sh
  2. # --------------------------------------------------------------------------
  3. # Copyright 1991, 1992 by Forschungszentrum Informatik (FZI)
  4. #
  5. # You can use and distribute this software under the terms of the licence
  6. # you should have received along with this program.
  7. # If not or if you want additional information, write to
  8. # Forschungszentrum Informatik, "STONE", Haid-und-Neu-Strasse 10-14,
  9. # D-7500 Karlsruhe 1, Germany.
  10. # --------------------------------------------------------------------------
  11. # 'INSTALL - 10/9/91 - Dietmar Theobald'
  12. #
  13. # INSTALL [ -boot ]
  14. #
  15.  
  16. if [ "$1" = '-boot' ] ; then
  17.    final_phase='+'
  18. elif [ $# -ne 0 ] ; then
  19.    echo >&2 '*** usage: INSTALL [-boot]'
  20. fi
  21.  
  22. set SOS*.tar.Z
  23.  
  24. [ $# -ne 1 ] && { echo >&2 '*** INSTALL: multiple SOS*.tar.Z files'; exit 1 ;}
  25.  
  26. tarfile="`basename $1 .Z`"
  27. tmpfile=/tmp/INSTALL.$$
  28.      WD="`pwd`"
  29.  
  30. [ "$final_phase" ] || {
  31.    echo '
  32. starting installation ...
  33. '
  34.    zcat -v $tarfile | tar xvBbf 20 - ; rm -f $tarfile
  35.  
  36.    echo -n '
  37. GNU compiler? (for AT&T type "n") '
  38.    read answer
  39.    if [ "$answer" = 'n' -o "$answer" = 'N' ] ; then
  40.       echo '   using AT&T compiler
  41. '
  42.        sedcmd1='s|\[__ATT__\]||'
  43.        sedcmd2='s|\[__GNU__\]|#|'
  44.       compiler='ATT'
  45.    else
  46.       echo '   using GNU compiler
  47. '
  48.        sedcmd1='s|\[__ATT__\]|#|'
  49.        sedcmd2='s|\[__GNU__\]||'
  50.       compiler='GNU'
  51.    fi
  52.    echo -n 'preparing source files '
  53.  
  54.    for file in Makefile commands.mk bin/* src/*/*_scp.c src/*/*_yacc.c \
  55.            `find . -name "INSTALL.*" -print`
  56.    do
  57.       echo -n '.'
  58.  
  59.       sed -e 's|\(#.*line.*"\)/.*\(/src/.*\)|\1'$WD'\2|'    \
  60.       -e 's+\([^|]\)__SOS_INSTALLED_PATH__+\1'$WD'+'    \
  61.       -e 's|__COMPILER__|'$compiler'|'            \
  62.       $file > $tmpfile
  63.       case "`basename $file`" in
  64.          commands.mk) sed -e "$sedcmd1" -e "$sedcmd2" $tmpfile > $file ;;
  65.        INSTALL.*) rm -f $file; mv $tmpfile $file; chmod +x $file   ;;
  66.            *) rm -f $file; mv $tmpfile $file               ;;
  67.       esac
  68.    done
  69.    chmod +x bin/*
  70.  
  71.    echo "
  72.  
  73. Proceed by customizing the SOS version for your local environment.
  74. Afterwards, finish the installation by 'INSTALL -boot'.
  75. "
  76.    exit 0
  77.    } # (final_phase)
  78.  
  79.  
  80. # ----------------------------
  81. # The final installation phase
  82. # ----------------------------
  83.  
  84. date
  85. boot_type='full'
  86.  
  87. arch="`( arch ) 2> /dev/null`"
  88. [ "$arch" = 'sun3' -o "$arch" = 'sun4' ] && boot_type='sun'
  89.  
  90. echo 'starting bootstrap ($boot_type) ...
  91. '
  92.         PATH="$WD/bin:"$PATH; export PATH
  93. SOSCONTAINER="$WD/cnt";       export SOSCONTAINER
  94. SOSC_BOOTING='+';          export SOSC_BOOTING
  95.  
  96. if [ "$boot_type" = 'sun' ] ; then
  97.    make all
  98. else
  99.    ./bin/sos-boot
  100. fi
  101.  
  102. rm -f cnt/*.out src/*/*.out *.out
  103.  
  104. date
  105. for i in 1 2
  106. do
  107.    if [ "$i" = '1' ] ; then
  108.       what='object files'
  109.        cmd="make clear_lib"
  110.    else
  111.       what='installation files'
  112.        cmd="rm -f $tarfile.Z INSTALL"
  113.    fi
  114.    echo -n "
  115. remove $what? "
  116.    read answer
  117.    if [ "$answer" = 'y' -o "$answer" = 'Y' ] ; then
  118.       echo "   $what will be removed"
  119.       $cmd
  120.    else
  121.       echo "   $what not removed"
  122.    fi
  123. done
  124.